import request from '@/router/axios';

//我的待办列表
/**
 * 返回格式
  [
    {"title":"张三邻居矛盾调解","date":"2020-10-11","type":"矛盾排查"},
    {"title":"公共绿化植物遭破坏举报","date":"2020-10-21","type":"事件上报"},
    {"title":"上访人员处理失当","date":"2020-10-12","type":"矛盾排查"},
    {"title":"青岛返济人员拒绝配合核酸检测","date":"2020-10-23","type":"事件上报"},
    {"title":"邻里矛盾处理","date":"2020-10-24","type":"矛盾排查"},
    {"title":"环评通知公告被撕毁事件举报","date":"2020-10-25","type":"矛盾排查"}
  ]
 */
export const getTodoList = () => {
  return request({
    url: '/api/smart-system/index/getTodoList',
    method: 'get',

  })
}

export const getNoticeList = () => {
  return request({
    url: '/api/smart-system/index/getNoticeList',
    method: 'get',

  })
}
//获取首页统计数量
/**
 * 返回结果数据
  [{"name":"实有人口","value":102400},{"name":"实有房屋","value":81212},{"name":"待受理","value":81212},{" ":"已受理","value":81212}]
 */
export const getIndexCount = () => {
  return request({
    url: '/api/smart-system/index/getIndexCount',
    method: 'get',
    params: { }
  })
}

//地区事件统计数据
/**
 * 返回结果数据：value按1--12月份统计数值
  [{"name":"事件总数","value":[320, 332, 301, 334, 390, 330, 590, 390, 330, 320, 332]},{"name":"已办事件数","value":[320, 332, 301, 334, 390, 330, 590, 390, 330, 320, 332]}]
 */
export const getIncidentCount = () => {
  return request({
    url: '/api/smart-system/index/getIncidentCount',
    method: 'get',
    params: { }
  })
}

//地区人口统计数据
/**
 * 返回结果数据：value按1--12月份统计数值
  [{"name":"特殊人群","value":[{"name":"2019年","value":[320,332,301,334,390,330,590,390,330,320,332]},
  {"name":"2020年","value":[320,332,301,334,390,330,590,390,330,320,332]}]},
  {"name":"外籍人口","value":[{"name":"2019年","value":[320,332,301,334,390,330,590,390,330,320,332]},
  {"name":"2020年","value":[320,332,301,334,390,330,590,390,330,320,332]}]}]
 */
export const getPeopleCount = () => {
  return request({
    url: '/api/smart-system/index/getPeopleCount',
    method: 'get',
    params: { }
  })
}

/**
 * 获取事件通知数量
 */
export const getNotifyCount = () => {
  return request({
    url: '/api/smart-system/oaNotify/getNotifyCount',
    method: 'get',
    params: { }
  })
}

/**
 * 获取事件通知列表
 */
export const getNotifyList = () => {
  return request({
    url: '/api/smart-system/oaNotify/getNotifyList',
    method: 'get',
    params: { }
  })
}

/**
 * 获取事件通知查看回传
 */
export const updateNotifyStatus = (id) => {
  return request({
    url: '/api/smart-system/oaNotify/updateNotifyStatus',
    method: 'post',
    params: {
      id
    }
  })
}
